package patterns.filter;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by lenovo on 2016/11/24 0024.
 * 具体标准实现类
 */
public class FilterSingle implements IFilter {
    @Override
    public List<Person> matchCriteria(List<Person> personList) {
        List<Person> singleList = new ArrayList<>();
        for (Person p : personList) {
            //单身状态的筛选标准
            if (p.getMaritalStatus().equalsIgnoreCase("single")) {
                singleList.add(p);
            }
        }
        return singleList;
    }
}
